﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using NUnit.Framework;
using ProDivingAdmin2salmon14;

namespace Test_ProDivingAdmin2salmon14
{
    [TestFixture]
    class TestDiver
    {
        [Test]
        public void CaltulateScore()
        {
            Diver diver = new Diver();
            Assert.IsEmpty(diver.diveList);

            diver = new Diver("Hej", "8904106682", 2, "SWE", new List<Dive>());
            Assert.IsEmpty(diver.diveList);
            Assert.AreEqual(diver.fullName, "Hej");

            List<Dive> diveList = new List<Dive>();
            for (int i = 0; i < 5; i++)
            {
                Dive temp = new Dive();
                temp.diveScore = i * 2 + 1;
                diveList.Add(temp);
            }
            diver.diveList = new List<Dive>(diveList);
            diver.CalculateScore();

            Assert.AreEqual(diver.totalScore, 25);
        }
    }
}
